package net.underrealm.src;

import java.io.File;

import org.ur_lwg.utils.Utils;

import net.underrealm.client.UnderRealm;

public class Cache {


	public Cache(UnderRealm mainThread) {	
		this.ur = mainThread;
		this.loadCacheIntoGame();
	}

	public boolean cacheLoaded() {
		if(this.cacheLoad == true) {
			return true;
		} else if(this.cacheLoad == false) {
			return false;
		} 
		return false;
	}
	
	
	public void loadCacheIntoGame() {
		if(!new File(fileManager.mainCacheDirWin).exists()) {
			fileManager.createCacheDir();
			return;
		}
		try {
			fileManager.cdDir(fileManager.mainCacheDirWin);
			fileManager.openFile(fileManager.cacheTxt);
			fileManager.openFile(fileManager.gameConfig);
		} catch(Exception e) {
			e.printStackTrace();
			Utils.error("Error loading Cache Files");
		}

	}

	public FileManager fileManager = new FileManager(new UnderRealm());
	public boolean cacheLoad = false;
	public UnderRealm ur;
}
